<template>
	<view class="invi-bg">
<!-- 		<u-navbar title="我的粉丝" :autoBack="true" :placeholder="true">
		</u-navbar> -->
		<view class="fans-top-box">
			<view class="title">
				我的邀请人
			</view>
			<view class="fans-mine">
				<image src="../../static/images/t1.jpg" mode="" class="img"></image>
				<text>用户123</text>
			</view>
			<view class="fans-num">
				<view class="left">
					<view class="name">
						粉丝总数
					</view>
					<view class="num">
						332
					</view>
				</view>
				<view class="btn">
				</view>
			</view>
		</view>


		<view class="fans-body bgfff">
			<view class="order-search">
				<u-search placeholder="搜索粉丝" v-model="keyword" bg-color="#f5f5f5" :showAction="false"
					@search="seachList()"></u-search>
			</view>
			<view class="fans-list" v-for="(item,index) in list" :key="index">
				<view class="top">
					<image :src="item.headimgurl" mode="" class="img"></image>
					<view class="right">
						<view class="name">
							{{item.nickname}}
						</view>
						<view class="time">
							{{item.created_at}}
						</view>
						<view class="code">
							邀请码：{{item.user_code}}
						</view>
					</view>
					<view class="btn">
						订单明细
					</view>
				</view>
				<view class="bottom">
					<view class="item">
						<view>
							订单量
						</view>
						<view class="num">
							{{item.order_count}}
						</view>
					</view>
					<view class="item">
						<view>
							累计收益
						</view>
						<view class="num">
							{{item.total_settlement_amount}}
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				size: 10,
				page: 1,
				list: [],
				keyword: ''
			}
		},
		onLoad() {
			this.getData()
		},
		methods: {
			seachList(){
				this.getData()
			},
			getData() {
				this.$api.levelUser({
					page:this.page,
					limit:this.size,
					nickname:this.keyword
				}).then(res => {
					this.list = res.users
				})

			}
		}
	}
</script>

<style scoped lang="scss">
	.fans-num {
		background: url('../../static/images/fans_bg.png')no-repeat center;
		background-size: 100% 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		height: 135rpx;
		border-radius: 14rpx;
		margin-top: 20rpx;
		padding-left: 34rpx;
		color: #fff;

		.btn {
			background: url('../../static/images/fang_btn.png')no-repeat center;
			background-size: 100% 100%;
			width: 208rpx;
			height: 66rpx;
			margin-right: 20rpx;
		}

		.name {
			font-size: 28rpx;
		}

		.num {
			font-size: 49rpx;
			font-weight: bold;
		}
	}

	.fans-top-box {
		background: #f5f5f5;
		padding: 20rpx;

		.title {
			font-size: 28rpx;
			font-weight: bold;
			margin-bottom: 20rpx;
		}
	}

	.fans-mine {
		display: flex;
		align-items: center;
		background: #fff;
		height: 80rpx;
		padding: 0 20rpx;
		border-radius: 16rpx;

		.img {
			height: 50rpx;
			width: 50rpx;
			border-radius: 50%;
			margin-right: 30rpx;
		}
	}

	.fans-body {
		border-radius: 20rpx 20rpx 0 0;
	}

	.bgfff {
		background: #fff;
		padding: 30rpx;
		border-radius: 10rpx;
	}

	.invi-bg {
		height: 100vh;
		width: 100%;
	}

	.fans-list {
		box-shadow: 0 0 10px 4px rgba(213, 213, 213, 0.42);
		border-radius: 20rpx;
		padding: 20rpx;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		gap: 30rpx;
		font-size: 24rpx;
		color: #888;
		margin-top: 30rpx;

		.right {
			margin-right: 20rpx;
		}

		.name {
			color: #333;
			font-size: 26rpx;
			font-weight: bold;
			white-space: nowrap;
			text-overflow: ellipsis;
			overflow: hidden;
		}

		.img {
			height: 140rpx;
			width: 140rpx;
			border-radius: 50%;
		}

		.top {
			display: flex;
			align-items: flex-start;
			justify-content: space-between;
			gap: 20rpx;

			.right {
				flex: 1;
				overflow: hidden;
				height: 120rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				padding: 10rpx 0;
			}
		}

		.bottom {
			display: flex;

			.item {
				display: flex;
				align-items: center;
				width: 50%;

				.num {
					margin-left: 30rpx;
					font-size: 28rpx;
					font-weight: bold;
					color: #333;
				}
			}
		}

		.btn {
			background: #f5f5f5;
			border-radius: 10rpx;
			padding: 10rpx 10rpx;
			color: #7d6c6c;
		}
	}
</style>